<template>
  <div class="dashboard-container" ref="dashboardRef">
    <div class="map-wrapper">
      <cesium-map />
    </div>
    <div class="dashboard-content">
      <top-navigation @toggleFullscreen="toggleFullscreen" />
      <div class="main-content">
        <left-panel />
        <div class="center-panel">
        </div>
        <right-panel />
      </div>
      <div class="bottom-actions">
        <div class="action-btn">
          <el-icon class="icon"><DataLine /></el-icon>
          雨水历程
        </div>
        <div class="action-btn">
          <el-icon class="icon"><Monitor /></el-icon>
          需水分析
        </div>
        <div class="action-btn">
          <el-icon class="icon"><TrendCharts /></el-icon>
          防汛调度
        </div>
        <div class="action-btn">
          <el-icon class="icon"><Warning /></el-icon>
          报警监视
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { DataLine, Monitor, TrendCharts, Warning } from '@element-plus/icons-vue'
import TopNavigation from '@/components/TopNavigation.vue'
import LeftPanel from '@/components/LeftPanel.vue'
import RightPanel from '@/components/RightPanel.vue'
import CesiumMap from '@/components/CesiumMap.vue'

const dashboardRef = ref<HTMLElement | null>(null)
const isFullscreen = ref(false)

const toggleFullscreen = () => {
  if (!document.fullscreenElement) {
    document.documentElement.requestFullscreen()
    isFullscreen.value = true
  } else {
    document.exitFullscreen()
    isFullscreen.value = false
  }
}

onMounted(() => {
  // Additional logic if needed on mount
})

onUnmounted(() => {
  // Additional logic if needed on unmount
})
</script>

<style lang="scss" scoped>
.dashboard-container {
  width: 100%;
  height: 100vh;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.map-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.dashboard-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;

  > * {
    pointer-events: auto;
  }
}

.main-content {
  flex: 1;
  display: flex;
  gap: 20px;
  height: calc(100% - 60px);
  overflow: hidden;
  pointer-events: none;

  > * {
    pointer-events: auto;
  }
}

.center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: none;
}

.bottom-actions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 10;

  .action-btn {
    padding: 8px 16px;
    background: rgba(13, 19, 35, 0.8);
    border: 1px solid rgba(63, 158, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;

    &:hover {
      background: rgba(63, 158, 255, 0.2);
      border-color: rgba(63, 158, 255, 0.3);
      color: #fff;
    }

    .icon {
      font-size: 20px;
    }
  }
}
</style> 